package cy.com.handler;

import cn.hutool.core.lang.Dict;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @ClassName : GlobalExceptionHandler
 * @Description : 全局异常处理类
 * @Author : dengyc
 * @Date: 2020-11-26 10:51
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(value = RuntimeException.class)
    public Dict handler(RuntimeException runtimeException)
    {
        return Dict.create().set("msg", runtimeException.getMessage()).set("code","500");
    }

}
